package com.foreknow.demo;

public class TestSingleton {
    public static void main(String[] args) {
        //通过调用静态方法获取Singleton类的对象(因为构造器是私有的，不能new)
        Singleton s1 = Singleton.getInstance();
        s1.setName("Gibson");
        Singleton s2 = Singleton.getInstance();
        System.out.println(s2.getName());
    }
}
